/*
 * tinwi.h
 *
 *  Created on: 13 июн. 2024 г.
 *      Author: layst
 */

#ifndef TINWI_H_
#define TINWI_H_

#include <inttypes.h>
#include "board.h"
#include "kl_libG070.h"

#define PARAM_CNT   6UL

union Params {
    int32_t arr[PARAM_CNT];
    struct {
#if 1 // Production
        int32_t smooth_min = 270, smooth_max = 540;
        int32_t brt_min = 45, brt_max = 108;
        int32_t tinwi_cnt = 18;
        int32_t off_brt = 4;
//        int32_t smooth_min = 270, smooth_max = 540;
//        int32_t brt_min = 180, brt_max = 255;
//        int32_t tinwi_cnt = 7;
//        int32_t off_brt = 3;
#else // Debug
        int32_t smooth_min = 540, smooth_max = 540;
        int32_t brt_min = 45, brt_max = 45;
        int32_t tinwi_cnt = 1;
        int32_t off_brt = 0;
#endif
    };
    int32_t GetSmooth() { return Random::Generate(smooth_min, smooth_max); }
    int32_t GetBrt()    { return Random::Generate(brt_min, brt_max); }
};

extern Params *curr_params;
extern uint16_t frame_buf[LED_CNT_TOTAL];

void InitTinwi();


#endif /* TINWI_H_ */
